import CopyOutlined from '@ant-design/icons/CopyOutlined';
import React from 'react';
import { copy } from '../_utils/dom';
import './index.less';
import RouteRender from './renders/RouteRender';

/**
 * json 数据展示
 */
export default (function (_ref) {
  var data = _ref.data;
  return /*#__PURE__*/ React.createElement(
    'div',
    {
      className: 'szzj-json-view-wrapper',
    },
    /*#__PURE__*/ React.createElement(CopyOutlined, {
      className: 'szzj-json-view-copy-icon',
      onClick: function onClick() {
        return copy(data);
      },
    }),
    /*#__PURE__*/ React.createElement(
      'pre',
      {
        className: 'szzj-json-view',
      },
      /*#__PURE__*/ React.createElement(
        'code',
        null,
        /*#__PURE__*/ React.createElement(RouteRender, {
          data: data,
        }),
      ),
    ),
  );
});
